//
//  WeiboAnnotationView.m
//  WXWeibo
//
//  Created by apple on 16/5/23.
//  Copyright © 2016年 zic_magic. All rights reserved.
//

#import "WeiboAnnotationView.h"
#import "WeiboAnnotation.h"
#import "UIImageView+WebCache.h"

@implementation WeiboAnnotationView

- (instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
       
        
        [self _createView];

    }
    
    
    return self;
    
}

- (void)_createView {
    
    UIImageView *bgImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nearby_map_people.png"]];
    [bgImgView sizeToFit];

    [self addSubview:bgImgView];
    
    UIImageView *userImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 6, 50, 50)];
    userImgView.layer.cornerRadius = 5;
    userImgView.layer.masksToBounds = YES;

    [bgImgView addSubview:userImgView];
    
    WeiboAnnotation *weiboAnnotation = (WeiboAnnotation *)self.annotation;
    
    [userImgView sd_setImageWithURL:[NSURL URLWithString:weiboAnnotation.weibo.user.profile_image_url]];
    
    
    
}

@end
